#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QMenu>
#include <QAction>
#include <QMenuBar>
#include <QStatusBar>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QLabel>
#include <QLCDNumber>
#include <QSpacerItem>
#include <QMessageBox>
#include <QKeyEvent>
#include <QTimer>
#include <QPushButton>
#include <QFile>
#include <QTcpServer>
#include <QTcpSocket>
#include <QDateTime>
#include "qcustomplot.h"

#include "DataTransfer.h"

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

private:
    Ui::MainWindow *ui;
    QTimer refresh_Timer;
    QTcpServer server;
    QTcpSocket *socket;
    QByteArray recvBuffer;
    void setup_customplot(QCustomPlot *customPlot);
    QByteArray outBlock;

public:

    MainWindow(QWidget *parent = NULL);
    ~MainWindow();

public slots:
    void new_client();
    void read_client_data();
    void client_dis();

private slots:
    void plot_refresh();
    void on_pushButton_clicked();
};
#endif // MAINWINDOW_H
